#include "realsense.h"

int main()
{
	int serialFd = 0;
	RealsenseDetector *rsDet = new RealsenseDetector(serialFd);
	rsDet->open_device();
	rsDet->start_device();
	int frameId = 0, stopCnt = 0;
	depth_info_mix info_pack;

	while(frameId++ < 100000){
		//printf("frameId=%d\n",frameId++);
		rsDet->process_one_frame();
		rsDet->get_kinect_info_pack(info_pack);
		rsDet->Robot_Send_Kinect_Info(info_pack);
		if(frameId++ %500 ==499){
				rsDet->stop_device();
			stopCnt = 50;
		}
		if(stopCnt >0){
			if(stopCnt-- == 1)
				rsDet->start_device();
		}
	}
	rsDet->stop_device();
	rsDet->close_device();
}
